<template>
    <div>
        欢迎您:{{username}}
        <table border="1" cellspacing='0'>
            <tr>
                <td>id</td>
                <td>用户名</td>
            </tr>
            <tr v-for="i in userlist">
                <td>{{i.id}}</td>
                <td>{{i.mobile}}</td>
            </tr>
        </table>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                username:localStorage.getItem('username'),
                userlist:[],
            }
        },
        methods:{
            getuserlist(){
                this.$axios.get('userlist')
                .then(res=>{
                    this.userlist=res.data.list
                })
            },
        },
        mounted(){
            this.getuserlist()
        },
    }
</script>

<style scoped>

</style>